package net.dgg.rz.common.utils.uniqueUtils;

import net.dgg.rz.production.entity.ProductOrder;

import java.util.Objects;

/**
 * @className UniqueProductOrder
 * @Author Quanlin Wan
 * @Description //TODO
 * @Date 2019/3/20 10:30
 **/
public class UniqueProductOrder extends ProductOrder {

    public UniqueProductOrder() {
    }

    @Override
    public boolean equals(Object obj) {
        try {
            if (!(obj instanceof UniqueProductOrder)) {
                return false;
            }
            UniqueProductOrder uniqueProductOrder = (UniqueProductOrder) obj;
            if (this.getProductId().equals(uniqueProductOrder.getProductId())
                    && this.getChannelId().equals(uniqueProductOrder.getChannelId()
            )) {
                return true;
            } else {
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }


    @Override
    public int hashCode() {
        return Objects.hash(this.getProductId(),this.getChannelId());
    }
}
